﻿using DroidClaim.BL.Utility;
using DroidClaim.Service.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DroidClaimBL.Dto
{
    public class RegisterSurveyorBlDto
    {
        public String SurveyerId { get; set; }
        public String Username { get; set; }
        public String Password { get; set; }
        public String Salt { get; set; }
        public String Name { get; set; }
        public String Surname { get; set; }
        public String Mobile { get; set; }
        public String Email { get; set; }
        public String PicturePath { get; set; }
        public String Code { get; set; }

        public DroidClaim.Service.Dto.SurveyorDto ToServiceDto()
        {
            DroidClaim.Service.Dto.SurveyorDto svDto = new DroidClaim.Service.Dto.SurveyorDto();

		    svDto.SurveyerId = SurveyerId;
		    svDto.Username = Username;
		    svDto.Password = Password;
		    svDto.Salt = Salt;
		    svDto.Name = Name;
		    svDto.Surname = Surname;
		    svDto.Mobile = Mobile;
		    svDto.Email = Email;
		    svDto.PicturePath = ServerFileHandle.CopyImageFile(PicturePath);
		    svDto.Code = Code;
            SurveyorLocationDto location = new SurveyorLocationDto();
            location.Status = 0;
            location.Latitude = 0;
            location.Longitude = 0;
            svDto.SurveyorLocation = location;

            return svDto;
        }
    }
}